﻿<%@ Page Title="" Language="C#" MasterPageFile="~/backend/Admin.Master" AutoEventWireup="true" CodeBehind="ClipEdit.aspx.cs" Inherits="mamnontuoitho7.backend.ClipEdit"  ValidateRequest="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="AdminTitleContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script language="javascript" type="text/javascript">
    function Validation() {
        var title = trim(document.getElementById("<%= txtTitleClip.ClientID %>").value);
        var des = trim(document.getElementById("<%= txtDescription.ClientID %>").value);

        var leng = title.length;
        if (leng == 0 || leng > 500) {
            alert("Tên album dài hơn 1 ký tự và không quá 500 ký tự");
            return false;
        }

        if (des.length == 0 || des.length > 1500) {
            alert("Mô tả bài viết không được để trống và không quá 1500 ký tự");
            return false;
        }
    }
    function trim(str) {
        return str.replace(/^\s+|\s+$/g, "");
    }
</script>
<form id="form1" runat="server">
    <!-- Begin one column tab content window -->
    <div class="onecolumn">
	    <div class="header">
		    <span>Thêm Mới Album Ảnh</span>
		    <div class="switchbutton">
                  <a href="ClipList.aspx" class="buttons stylebutton">Danh sách Video</a>
                  <a href="ClipCreate.aspx" class="buttons stylebutton">Thêm mới</a>
		    </div>
	    </div>
	    <br class="clear"/>
	    <div class="content">
            <div id="tab1_content" class="tab_content">
                <div class="tableform">
                    <div>
                        Tên clip:<br />
                        <asp:TextBox ID="txtTitleClip" runat="server" style="width:630px;"></asp:TextBox></div><br />
                    <div>
                     <iframe src="http://www.youtube.com/embed/<%=_dt.Rows[0]["VideoURL"].ToString()%>"
                                width="640" height="390" frameborder="0" allowfullscreen wmode="Opaque"></iframe>
                    </div><br />
                    <div>
                        Đường dẫn clip mới:<br />
                        <asp:TextBox ID="txtURLClip" runat="server" style="width:630px"></asp:TextBox></div><br />
                    <div>
                        Mô tả clip:<br />
                        <asp:TextBox ID="txtDescription" TextMode="MultiLine" runat="server" style="width:630px; min-height:100px;"></asp:TextBox></div><br />
                    <p>
				        <asp:Button ID="btnClipEdit" runat="server" Text="Cập nhật" 
                            onclick="btnClipEdit_Click" OnClientClick="return Validation()"/>
                        <asp:Button ID="btnRefresh" runat="server" Text="Làm lại" onclick="btnRefresh_Click" />
                        </p>
                </div>
	  		    <br class="clear"/>
		    </div>
        </div>
    </div>
    <!-- End one column tab content window -->
</form>
</asp:Content>
